<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function show(){
				//创建异步
				var xhr=new XMLHttpRequest();
				//接收请求
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4 && xhr.status==200){
						var r=xhr.responseText;
						d1.innerHTML=r;
					}
				}
				//创建请求
				xhr.open("get","http://127.0.0.1:8080/ajax_03/getList",true);
				//发送请求,如果为查询字符串可以为null,可以为空
				xhr.send(null);
			}
		</script>
	</head>
	<body>
		<button onclick="show()">按钮</button>
		<div id="d1"></div>
	</body>
</html>
